/* eslint-disable no-unused-vars */
'use strict';


// back_no: STRING(512),
// num: INTEGER,
// price: FLOAT,
// reject_price: FLOAT,
// status: STRING(255),
// back_date: DATE,

module.exports = app => {
  const { INTEGER, STRING, DATE, TEXT, FLOAT } = app.Sequelize;

  const Purchase = app.model.define(
    'purchase',
    {
      id: { type: INTEGER, primaryKey: true, autoIncrement: true },
      store_name: {
        type: STRING(255),
        allowNull: true,
        comment: '店铺名',
      },
      in_store_date: {
        type: DATE,
        allowNull: true,
        comment: '采购日期',
      },
      user_name: {
        type: STRING(512),
        allowNull: true,
        comment: '姓名',
      },
      telephone: {
        type: STRING(255),
        allowNull: true,
        comment: '电话',
      },
      address: {
        type: STRING(512),
        allowNull: true,
        comment: '地址',
      },
      model: {
        type: STRING(512),
        allowNull: true,
        comment: '型号',
      },
      out_no: {
        type: STRING(512),
        allowNull: true,
        comment: '发出单号',
      },
      back_cause: {
        type: TEXT,
        allowNull: true,
        comment: '退回原因',
      },
      back_no: {
        type: STRING(512),
        allowNull: true,
        comment: '退回单号',
      },
      num: {
        type: INTEGER,
        allowNull: true,
        comment: '数量',
      },
      price: {
        type: FLOAT,
        allowNull: true,
        comment: '价格',
      },
      reject_price: {
        type: FLOAT,
        allowNull: true,
        comment: '拒收费',
      },
      status: {
        type: STRING(255),
        allowNull: true,
        comment: '签收状态',
      },
      back_date: {
        type: DATE,
        allowNull: true,
        comment: '退货单日期',
      },
      remark: {
        type: TEXT,
        allowNull: true,
        comment: '备注',
      },
      template1: {
        type: TEXT,
        allowNull: true,
        comment: '冗余字段',
      },
      template2: {
        type: STRING(512),
        allowNull: true,
        comment: '冗余字段',
      },
      template3: {
        type: STRING(512),
        allowNull: true,
        comment: '冗余字段',
      },
      template4: {
        type: INTEGER,
        allowNull: true,
        comment: '冗余字段',
      },
      created_at: DATE,
      updated_at: DATE,
    },
    {
      timestamps: true,
      createdAt: 'created_at',
      updatedAt: 'updated_at',
    }
  );
  return Purchase;
};
